package com.mob.android.memory;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.GridView;

public class MemoryMainViewActivity extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        
        final GridView gridview = (GridView) findViewById(R.id.gridview);
        ImageAdapterData.getInstance().setGridView(gridview);
        gridview.setAdapter(new ImageAdapter(this));        
        
		gridview.setOnItemClickListener(new OnItemClickListener() 
        {
            public void onItemClick(AdapterView<?> parent, View v, int position, long id) 
            {   
            	if (!ImageAdapterData.getInstance().picturesCoverInProgress) {
            		ImageAdapterData.getInstance().handleClickedImage(position);
            	}
            }
        });  
    }
}